<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr1 = [1,2,'pig','小李同学','小汪'];
        for (var i = 0; i < arr1.length; i++) {
            console.log(arr1[i]);
            sum += arr1[i]
        }
        var average = 0;
        average = sum / arr1.length;
        console.log(sum,average);
    </script>
</head>
<body>
    
</body>
</html>